package com.jeez.common.domain;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author: Felix
 * @date: 2018-7-1
 * @version: v1.0
 * @description:
 */
@Setter
@Getter
public class RestResult implements Serializable {

    /**
     * 状态码
     */
    private int statusCode = 200;

    /**
     * 消息
     */
    private String message;

    /**
     * 是否成功
     */
    private boolean success = true;

    /**
     * 返回数据
     */
    private Object data;

    public static RestResult getSuccess() {
        RestResult result = new RestResult();
        result.setMessage("操作成功！");
        return result;
    }

    public static RestResult getError() {
        RestResult result = new RestResult();
        result.setStatusCode(-1);
        result.setSuccess(false);
        return result;
    }

}
